<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RoubSite-登陆</title>
<!-- basic styles -->

<script src="{$__WEBPATH__}/static/common/js/roubSite.js"></script>
<script type="text/javascript">RS.webPath='{$__WEBPATH__}';</script>
<script src="{$__WEBPATH__}/static/common/js/import.js"></script>
<link rel="stylesheet" type="text/css" href="{$__WEBPATH__}/static/common/css/login.css">
<style>
body, html {
	font-size: 100%;
	padding: 0;
	margin: 0;
}

body {
	background: #494A5F;
	color: #D5D6E2;
	font-weight: 500;
	font-size: 1.05em;
	font-family: "Microsoft YaHei", "Segoe UI", "Lucida Grande", Helvetica,
		Arial, sans-serif;
}

.htmleaf-header {
	padding: 1em 190px 1em;
	letter-spacing: -1px;
	text-align: center;
	background: #66677c;
}

*, *:after, *:before {
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	box-sizing: border-box;
}

.htmleaf-header h1 span {
	display: block;
	font-size: 60%;
	font-weight: 400;
	padding: 0.8em 0 0.5em 0;
	color: #c3c8cd;
}
</style>
</head>
<body>
	<div class="htmleaf-container">
		<header class="htmleaf-header">
			<h1>
				RoubSite <span>快速开发框架</span>
			</h1>
		</header>
		<div class="demo form-bg" style="padding: 20px 0;">
			<div class="container">
				<div class="row">
					<div class="col-md-offset-3 col-md-6">
						<form class="form-horizontal" id="login" onsubmit="return false;">
							<span class="heading">管理员登录</span>
							<div class="form-group">
								<input type="text" class="form-control" name="username" placeholder="用户名或电子邮件"> <i class="fa fa-user"></i>
							</div>
							<div class="form-group help">
								<input type="password" class="form-control" name="pwd" placeholder="密　码"> <i class="fa fa-lock"></i> <span href="#" class="fa fa-question-circle"></span>
							</div>
							<div class="form-group help">
								<input type="text" class="form-control" name="verifyImg" placeholder="验证码" style="width:200px;"> <i class="fa fa-circle-thin"></i>
								<img src="{$__WEBPATH__}/admin/verifyCode" alt="验证码" id="loginVerify" style="    width: 100px; display: inline-block; position: absolute; top: 0px;">
							</div>
							<div class="form-group">
								<button type="submit" class="btn btn-default" onclick="login()">登录</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
	$("#loginVerify").click(function(){$(this).attr("src","");$(this).attr("src",RS.webPath+"/admin/verifyCode?v="+Math.random())});function refCOde(){var url=RS.webPath+"/admin/verifyCode?v="+Math.random();$("#loginVerify").attr("src","");$("#loginVerify").attr("src",url)}var systemId="{$systemId}",redirectUri="{$redirectUri}",sign="{$sign}";
	</script>
	<script>
		function login() {
			$.ajax({
					url : '{$__WEBPATH__}/sso/index/ssoLoginRequest',
					data : $('form').serialize(),
					type : "post",
					dataType:"json",
					success : function(data) {
						switch (data.status) {
						case '-1':
							layer.msg("该用户不存在!");
							refCOde();
							break;
						case '-2':
							layer.msg("密码错误!");
							refCOde();
							break;
						case '-3':
							layer.msg("验证码错误!");
							refCOde();
							break;
						case '1':
							layer.msg("登陆成功");
							window.location.href = RS.webPath+"/sso/index/getAuthorizationCode?system_id=" + systemId
							+ "&redirect_uri=" + redirectUri + "&sign=" + sign+;
							break;

						default:
							break;
						}
					}
			});

		}
	</script>
</body>
</html>